const fs = require('fs')
const zlib = require('zlib')
const http = require('http')
const gzip = zlib.createGzip()
http.createServer((req, res) => {
  res.writeHead(200, { "Content-Encoding": "gzip" })
  const rs = fs.createReadStream('./data.js', 'utf8')
  rs.pipe(gzip).pipe(res)
}).listen(80, () => {
  console.log('创建成功！')
})
